package com.luoran.bartalks.service.impl;

import java.util.List;

import org.beetl.sql.core.engine.PageQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.luoran.bartalks.dao.IBtContainerTemplateDao;
import com.luoran.bartalks.entity.BaseInfo;
import com.luoran.bartalks.entity.biz.BtContainerTemplate;
import com.luoran.bartalks.service.IBtContainerTemplateService;

@Service
public class BtContainerTemplateService implements IBtContainerTemplateService {

	@Autowired
	private IBtContainerTemplateDao dao;

	@Override
	public PageQuery<? extends BaseInfo> getQueryList(PageQuery<? extends BaseInfo> pageQuery) {
		dao.queryPage(pageQuery);
		return pageQuery;
	}

	@Override
	public BtContainerTemplate getContainerTemplateByCode(String templateCode, String companyId) {

		return dao.getContainerTemplateByCode(templateCode, companyId);
	}

	@Override
	public BtContainerTemplate addContainerTemplate(BtContainerTemplate template) {
		dao.insert(template);
		return template;
	}

	@Override
	public void editContainerTemplate(BtContainerTemplate template) {
		dao.updateTemplateById(template);
	}

	@Override
	public BtContainerTemplate getContainerTemplateById(String id) {

		return dao.single(id);
	}

	@Override
	public void deleteContainerTemplate(String id) {

		dao.deleteById(id);
	}

	@Override
	public List<BtContainerTemplate> getContainerTemplateByCompanyId(String companyId) {
		return dao.getContainerTemplateByCompanyId(companyId);
	}

	@Override
	public List<BtContainerTemplate> getContainerTemplateStencilList(String companyId) {
		return dao.getContainerTemplateStencilList(companyId);
	}
}
